namespace g_gongjianta
{
    public class DungeonMainComponent : UnitComponent<Dungeon>
    {
        public override void Awake()
        {
            base.Awake();

            CreateWalls();

            CreateLairs();
        }

        public override void Dispose()
        {
            if (IsDisposed) return;

            base.Dispose();
        }

        private void CreateWalls()
        {
            var list = Unit.Conf.Walls;

            foreach (var item in list)
            {
                G.Factory.Create<Wall, TblDungeon.WallConf>(item);
            }
        }

        private void CreateLairs()
        {
            var list = Unit.Conf.Lairs;

            foreach (var item in list)
            {
                G.Factory.Create<Lair, TblDungeon.LairConf>(item);
            }
        }
    }
}